
package cn.com.iscs.sqlProject.controller;

import cn.com.iscs.sqlProject.mapper.CfOperationUnitMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

import static cn.com.iscs.sqlProject.constants.Constants.THREAD_LOCAL;

/**
 * Created by yejunjun on 2017/3/1.
 */

@Controller
public class HelloController {
	private Logger logger = LoggerFactory.getLogger(HelloController.class);


	@Resource
	private CfOperationUnitMapper cfOperationUnitMapper;


	@RequestMapping(value = "/users", method = RequestMethod.GET)
	public
	@ResponseBody
	List<String> testUserDao(@RequestParam(required = true) Long cfOperationUnitUkid, HttpServletRequest request) {

		cfOperationUnitMapper.get(cfOperationUnitUkid);
		cfOperationUnitMapper.get(cfOperationUnitUkid);
		cfOperationUnitMapper.get(cfOperationUnitUkid);
		cfOperationUnitMapper.get(cfOperationUnitUkid);
		List<String> sqls = THREAD_LOCAL.get();
		THREAD_LOCAL.set(new ArrayList<String>());
		return sqls;
	}

}

